package com.itheima.service;

import com.itheima.pojo.Bird;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class BirdServiceImpl implements BirdService{
    @Override
    //模拟查找到的鸟,奇数是乌鸦，偶数是凤凰
    public List<Bird> findAll() {
        List<Bird> birdList = new ArrayList<Bird>();
        for (int i=0;i<10;i++) {
            Bird bird = new Bird();
            bird.setId(i);

            if (i%2 == 0)
                bird.setType("乌鸦");
            else
                bird.setType("凤凰");

            birdList.add(bird);
        }
        return birdList;
    }
}
